//
//  APPPlistView.m
//  AppManagement
//
//  Created by 珍 on 16/5/16.
//  Copyright © 2016年 abb.is.dev.eas. All rights reserved.
//

#import "APPPlistView.h"
#import "UIImageView+WebCache.h"
@implementation APPPlistView

+(instancetype)appViewWithApp:(MEAPPManager *)app for:(CGRect)frame {

    // 读取 xib 文件
    APPPlistView *appView = [[[NSBundle mainBundle] loadNibNamed:@"APPPlistView" owner:nil options:nil] firstObject];
    // 初始化
   [appView.imageIcon sd_setImageWithURL:[NSURL URLWithString:app.icon] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
    
}];
    appView.titleLable.text = app.appName;
    appView.frame = frame;

    return appView;
}

- (IBAction)btn_click:(UIButton *)sender {


    if ( self.progressBar.hidden == NO) {
        return;
    }
    // 按钮tag
    if ([self.delegate respondsToSelector:@selector(aPPPlistView:button_click:)]) {
        [self.delegate aPPPlistView:self button_click:sender];
    }
}


- (void)removeProgressBar{
    self.progressBar.hidden = YES;
    [self.progressBar removeFromSuperview];

}
@end
